package cn.kgc.vuedemoebook2.controller;

import cn.kgc.vuedemoebook2.pojo.Category;
import cn.kgc.vuedemoebook2.pojo.ResultEntity;
import cn.kgc.vuedemoebook2.service.CategoryServcie;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author niejianhang
 * @create 2020-05-19 14:37
 */
@RestController
public class CategoryController {

    @Resource
    CategoryServcie categoryServcie;

    //查询图书所有分类
    @RequestMapping("/getCategoryList")
    public ResultEntity<List<Category>> getCategoryList(){
        List<Category> list = categoryServcie.selAll();
        return ResultEntity.successWithoutData(list);
    }

}
